using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class MainUI : MonoBehaviour
{
    [SerializeField] private string sceneName;
    [SerializeField] private Button NewGameButton;
    [SerializeField] private Button ContinueGameButton;
    [SerializeField] private Button QuitGameButton;
    private void Start()
    {
        NewGameButton.onClick.AddListener(NewGame);
        ContinueGameButton.onClick.AddListener(LoadGame);
        QuitGameButton.onClick.AddListener(QuitGame);
        ContinueGameButton.gameObject.SetActive(SaveManager.Instance.CanLoadGame());
    }
    private void NewGame()
    {
        SaveManager.Instance.NewGame();
        SceneManager.LoadScene(sceneName);
    }
    private void LoadGame()
    {
        SceneManager.LoadScene(sceneName);
    }
    private void QuitGame()
    {
        Application.Quit();
    }
}
